package com.example.prodecttest.constant;

import java.util.LinkedHashMap;

import static com.example.prodecttest.constant.BaseCommon.YES;

/**
 * @description: 设备分类枚举
 * @author: fan
 * @date: 2022/3/7 11:31
 * @version: 1.0
 */
public enum EquipmentClassificationEnum {


    //光伏区 升压站区 机械设备 环保设备 常用材料 安防设备
    PV("PV","光伏区",YES),BS("BS","升压站区",YES),ME("ME","机械设备",YES),
    EE("EE","环保设备",YES),CU("CU","常用材料",YES),SE("SE","安防设备",YES);

    String type;

    String name;

    /**使用状态*/
    Integer state;

    EquipmentClassificationEnum(String type, String name,Integer state) {
        this.type = type;
        this.name = name;
        this.state = state;
    }

    public static LinkedHashMap<String, EquipmentClassificationEnum> getArrayMessage() {
        LinkedHashMap<String, EquipmentClassificationEnum> responseMessages = new LinkedHashMap<>();
        for (EquipmentClassificationEnum typeEnum : EquipmentClassificationEnum.values()) {
            responseMessages.put(typeEnum.type, typeEnum);
        }
        return responseMessages;
    }


    public static EquipmentClassificationEnum getValue(String type) {
        return getArrayMessage().get(type);
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public Integer getState() {
        return state;
    }
}
